Hi David,
Good questions, did you know that for debugging you can open the KMotion|Console Screen to see messages?
Do you have separate limit switches on each
end of travel? Or both switches wired together?
Regards TK
Group: DynoMotion |
Message: 6232 |
From: David Stevenson |
Date: 12/7/2012 |
Subject: Re: KMotionCNC Question |
Hi
Tom,
I have been
using the Console Screen, but I am thinking down the road where I really don't
want the operator in the KMotion area, due to the danger of something getting
modified by accident.
The 2 axis
machine of mine has a limit switch on each end of both axis.
Something
else I was wondering about... how would one go about changing functions
associated with a gamepad device? Is that a driver from Logitech or
whomever?
Thank
you,
David.
Hi David,
Good
questions, did you know that for debugging you can open the KMotion|Console
Screen to see messages?
Do
you have separate limit switches on each end of travel? Or both switches
wired together?
Regards
TK
Group: DynoMotion |
Message: 6233 |
From: Tom Kerekes |
Date: 12/7/2012 |
Subject: Re: KMotionCNC Question |
Hi David,
I wouldn't expect the Operator to be debugging things. Any thoughts on where/how to put a console screen in KMotionCNC? We're trying to keep things simple.
I was asking if the limit switches at both ends are wired in parallel or series and only one signal goes into KFLOP or do they go in as two separate signals. If two separate signals, then the "Disallow drive into limit" option should allow you to re-initialize while in the limit and move back inside the limits.
The gamepad functions are all hard coded within KMotionCNC in the VS2008 C++ MFC code. You would need to edit the code and recompile to change things.
Regards TK
Group: DynoMotion |
Message: 6234 |
From: David Stevenson |
Date: 12/7/2012 |
Subject: Re: KMotionCNC Question |
Hi
Tom,
I was
thinking just a single line size box on the main screen, perhaps with a scroll
button that would simply show the last message printed by the system. Mach has
one (they use an error box or something like that) and it's handy for seeing
status messages... like "X+ Limit Triggered" or something
similar.
My 4 limits
have 4 separate inputs. I was thinking it can't re-initialize because the
motors have to move "ever-so-slightly" in the wrong direction to initialize
the servos.
Is
the file you mention available to edit? I have a free version of Visual
Studio, does that work?
Thanks,
David.
Hi David,
I
wouldn't expect the Operator to be debugging things. Any thoughts on
where/how to put a console screen in KMotionCNC? We're trying to keep
things simple.
I
was asking if the limit switches at both ends are wired in parallel or series
and only one signal goes into KFLOP or do they go in as two separate
signals. If two separate signals, then the "Disallow drive into limit"
option should allow you to re-initialize while in the limit and move back
inside the limits.
The
gamepad functions are all hard coded within KMotionCNC in the VS2008 C++ MFC
code. You would need to edit the code and recompile to change
things.
Regards
TK
Group: DynoMotion |
Message: 6235 |
From: Tom Kerekes |
Date: 12/7/2012 |
Subject: Re: KMotionCNC Question |
Hi David,
I don't recall what kind of system you have, but the Limits trip on commanded motion in the wrong direction, not actual (encoder) motion in the wrong direction, so I'm not sure why there would be a problem.
The source code is available see KMotionCNCDlg.cpp. But KMotionCNC is written in MFC (Microsoft Foundation Class) which is an older C++ Libraries which is not supported by the free Express versions. You need at least the Standard Version of Visual Studio.
Regards TK
Group: DynoMotion |
Message: 6236 |
From: David Stevenson |
Date: 12/7/2012 |
Subject: Re: KMotionCNC Question |
Hi
Tom,
My system
uses a SnapAmp with 3 phase brushless motors. In KMotionCNC if I jog into a
limit, the readout changes to yellow from green and the axis is disabled.
Neither the gamepad or the jog buttons will move it back off the limit
and the axis won't re-initialize with the User
button.
Thanks for
the information on the code.
Thanks
again,
David.
Hi David,
I
don't recall what kind of system you have, but the Limits trip on commanded
motion in the wrong direction, not actual (encoder) motion in the wrong
direction, so I'm not sure why there would be a problem.
The
source code is available see KMotionCNCDlg.cpp. But KMotionCNC is
written in MFC (Microsoft Foundation Class) which is an older C++ Libraries
which is not supported by the free Express versions. You need at least
the Standard Version of Visual Studio.
Regards
TK
Group: DynoMotion |
Message: 6237 |
From: Tom Kerekes |
Date: 12/7/2012 |
Subject: Re: KMotionCNC Question |
Hi David,
User Button (Init C Program) should re-initialize while in the limit if you are using the "Disable drive into limit" mode. If you post your Init.c program I can look at it.
Regards TK
Group: DynoMotion |
Message: 6238 |
From: David Stevenson |
Date: 12/7/2012 |
Subject: Re: KMotionCNC Question |
Hi
Tom,
here is the
code...
#include
"KMotionDef.h"
// Home and set the
commutation for two 3-phase brushless motors
// Assume index
mark
main()
{ float k=0,A=10.0f; // set coil current
amplitude PWM units double
p0; WriteSnapAmp(SNAP0+SNAP_SUPPLY_CLAMP0
,SNAP_CONVERT_VOLTS_TO_ADC(80.0)); WriteSnapAmp(SNAP0+SNAP_SUPPLY_CLAMP1
,SNAP_CONVERT_VOLTS_TO_ADC(80.0)); WriteSnapAmp(SNAP0+SNAP_SUPPLY_CLAMP_ENA0,1); WriteSnapAmp(SNAP0+SNAP_SUPPLY_CLAMP_ENA1,1); WriteSnapAmp(SNAP0+SNAP_PEAK_CUR_LIMIT0,12);
// current limit (12 for
BSM80C-375) WriteSnapAmp(SNAP0+SNAP_PEAK_CUR_LIMIT1,12); //
current limit Delay_sec(1); // wait for any fault to
clear // rotate until we find the index mark for
ch0
ch0->Enable=FALSE; ch0->OutputChan0=8; for
(;;) {
WaitNextTimeSlice(); Write3PH(ch0,A,
++k/10000.0); // move the pole
if
(ReadBit(66)) // check for index
mark { p0=ch0->Position; // save
position ch0->Position=0; // set current position
to Zero ch0->CommutationOffset =
2875; printf("Position X axis =
%f\n",p0); break; }
}
Write3PH(ch0,0,0); // turn off the
coil
// define the axis
as 3 phase BRUSHLESS_3PH_MODE // and set low PID
gains ch0->InputMode=ENCODER_MODE; ch0->OutputMode=BRUSHLESS_3PH_MODE; ch0->Vel=150000; ch0->Accel=1e+008; ch0->Jerk=1e+010; ch0->P=0.1; ch0->I=0; ch0->D=0; ch0->FFAccel=0; ch0->FFVel=0; ch0->MaxI=200; ch0->MaxErr=100000; ch0->MaxOutput=2000; ch0->DeadBandGain=1; ch0->DeadBandRange=0; ch0->InputChan0=8; ch0->InputChan1=4; ch0->OutputChan0=8; ch0->OutputChan1=9; ch0->MasterAxis=-1; ch0->LimitSwitchOptions=0x4b49001f; ch0->InputGain0=1; ch0->InputGain1=1; ch0->InputOffset0=0; ch0->InputOffset1=0; ch0->OutputGain=1; ch0->OutputOffset=0; ch0->SlaveGain=1; ch0->BacklashMode=BACKLASH_OFF; ch0->BacklashAmount=0; ch0->BacklashRate=0; ch0->invDistPerCycle=0.0002; ch0->Lead=0; ch0->MaxFollowingError=400000; ch0->StepperAmplitude=20;
ch0->iir[0].B0=1; ch0->iir[0].B1=0; ch0->iir[0].B2=0; ch0->iir[0].A1=0; ch0->iir[0].A2=0;
ch0->iir[1].B0=1; ch0->iir[1].B1=0; ch0->iir[1].B2=0; ch0->iir[1].A1=0; ch0->iir[1].A2=0;
ch0->iir[2].B0=1; ch0->iir[2].B1=0; ch0->iir[2].B2=0; ch0->iir[2].A1=0; ch0->iir[2].A2=0;
EnableAxisDest(0,ch0->Position); // Enable ch0 servo
where we currently are // rotate until we find the
index mark for ch1
ch1->Enable=FALSE; ch1->OutputChan0=10; for
(;;) {
WaitNextTimeSlice(); Write3PH(ch1,A,
++k/10000.0); // move the pole
if (ReadBit(67)) // check for index
mark { p0=ch1->Position; // save
position ch1->Position=0; // set current position
to Zero ch1->CommutationOffset =
-395; printf("Position Y axis =
%f\n",p0); break; }
}
Write3PH(ch1,0,0); // turn off the
coil
// define the axis as 3 phase BRUSHLESS_3PH_MODE // and set
low PID
gains ch1->InputMode=ENCODER_MODE; ch1->OutputMode=BRUSHLESS_3PH_MODE; ch1->Vel=150000; ch1->Accel=1e+008; ch1->Jerk=1e+010; ch1->P=0.1; ch1->I=0; ch1->D=0; ch1->FFAccel=0; ch1->FFVel=0; ch1->MaxI=200; ch1->MaxErr=100000; ch1->MaxOutput=2000; ch1->DeadBandGain=1; ch1->DeadBandRange=0; ch1->InputChan0=10; ch1->InputChan1=4; ch1->OutputChan0=10; ch1->OutputChan1=9; ch1->MasterAxis=-1; ch1->LimitSwitchOptions=0x4a48001f; ch1->InputGain0=-1; ch1->InputGain1=1; ch1->InputOffset0=0; ch1->InputOffset1=0; ch1->OutputGain=1; ch1->OutputOffset=0; ch1->SlaveGain=1; ch1->BacklashMode=BACKLASH_OFF; ch1->BacklashAmount=0; ch1->BacklashRate=0; ch1->invDistPerCycle=-0.0002; ch1->Lead=0; ch1->MaxFollowingError=400000; ch1->StepperAmplitude=20;
ch1->iir[0].B0=1; ch1->iir[0].B1=0; ch1->iir[0].B2=0; ch1->iir[0].A1=0; ch1->iir[0].A2=0;
ch1->iir[1].B0=1; ch1->iir[1].B1=0; ch1->iir[1].B2=0; ch1->iir[1].A1=0; ch1->iir[1].A2=0;
ch1->iir[2].B0=1; ch1->iir[2].B1=0; ch1->iir[2].B2=0; ch1->iir[2].A1=0; ch1->iir[2].A2=0;
EnableAxisDest(1,ch1->Position); // Enable ch1
servo where we currently
are DefineCoordSystem(0,1,-1,-1); }
Hi David,
User
Button (Init C Program) should re-initialize while in the limit if you are
using the "Disable drive into limit" mode. If you post your Init.c
program I can look at it.
Regards
TK
Group: DynoMotion |
Message: 6239 |
From: Tom Kerekes |
Date: 12/7/2012 |
Subject: Re: KMotionCNC Question |
Hi David,
Strange. I don't see anything wrong and I tried it (simulating limits) and don't see a problem.
What happens exactly? After you hit a limit
and push the Init button? What if anything is printed on the Console Screen? Are the Axes enabled on the Axis Screen?
What Version are you using?
Regards TK
Group: DynoMotion |
Message: 6240 |
From: David Stevenson |
Date: 12/7/2012 |
Subject: Re: KMotionCNC Question |
Hi
Tom,
I will fire
it up tomorrow morning and post the details.
Thanks for
your help,
David.
Hi David,
Strange.
I don't see anything wrong and I tried it (simulating limits) and don't see a
problem.
What
happens exactly? After you hit a limit and push the Init button?
What if anything is printed on the Console Screen? Are the Axes enabled
on the Axis Screen?
What
Version are you using?
Regards
TK
Group: DynoMotion |
Message: 6241 |
From: David Stevenson |
Date: 12/7/2012 |
Subject: Re: KMotionCNC Question |
Hi
Tom,
WOW, that
KMotionCNCDlg.cpp is quite a file! Does that file get compiled and loaded
when the software runs, or is there a compiled version that runs when CNC
starts? I ask because if a couple of minor changes were made to the code it
could help with how my system (reverse a couple of movement settings)
works. This mainly because of where the controller is positioned on the
machine.
Thanks,
David.
Hi David,
I
don't recall what kind of system you have, but the Limits trip on commanded
motion in the wrong direction, not actual (encoder) motion in the wrong
direction, so I'm not sure why there would be a problem.
The
source code is available see KMotionCNCDlg.cpp. But KMotionCNC is
written in MFC (Microsoft Foundation Class) which is an older C++ Libraries
which is not supported by the free Express versions. You need at least
the Standard Version of Visual Studio.
Regards
TK
Group: DynoMotion |
Message: 6243 |
From: Tom Kerekes |
Date: 12/8/2012 |
Subject: Re: KMotionCNC Question |
Hi David,
That KMotionCNCDlg.cpp is mostly all of the Windows GUI for KMotionCNC. It is compiled by VS2008 Standard Version as part of KMotionCNC.exe and runs on the PC. For changes to the GamePad look into the DoJoyStick() function.
Regards TK
Group: DynoMotion |
Message: 6244 |
From: David Stevenson |
Date: 12/8/2012 |
Subject: Re: KMotionCNC Question |
Hi
Tom,
So if I
change the .cpp file on my system, will my interface change?
Thanks,
David.
Hi David,
That
KMotionCNCDlg.cpp is mostly all of the Windows GUI for KMotionCNC. It is
compiled by VS2008 Standard Version as part of KMotionCNC.exe and runs on the
PC. For changes to the GamePad look into the DoJoyStick()
function.
Regards
TK
Group: DynoMotion |
Message: 6245 |
From: Tom Kerekes |
Date: 12/8/2012 |
Subject: Re: KMotionCNC Question |
Hi David,
If you also use VS2008 Standard Version and re-compile KMotionCNC.exe
Regards TK
Group: DynoMotion |
Message: 6246 |
From: David Stevenson |
Date: 12/8/2012 |
Subject: Re: KMotionCNC Question |
Thanks
Tom.
I wasn't
sure if it was a separate routine that is called by
KMotionCNC.exe
David
Hi David,
If
you also use VS2008 Standard Version and re-compile
KMotionCNC.exe
Regards
TK
Group: DynoMotion |
Message: 6251 |
From: David Stevenson |
Date: 12/10/2012 |
Subject: Re: KMotionCNC Question |
Hi
Tom,
When I jog
into a limit, that axis is disabled. Console says axis is disabled due to limit
switch. Initialization doesn't do anything except disable the other axis.
HOWEVER, the homeaxis User button does still work and resets the two axis to
working status. I guess I never tried the Homing button in that situation.
:)
So I guess
everything is good!
Thanks for
your help (and for 430g too),
David.
Hi David,
Strange.
I don't see anything wrong and I tried it (simulating limits) and don't see a
problem.
What
happens exactly? After you hit a limit and push the Init button?
What if anything is printed on the Console Screen? Are the Axes enabled
on the Axis Screen?
What
Version are you using?
Regards
TK
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |